package net.web.service;

import net.web.common.utils.PageInfo;
import net.web.entity.User;

import java.util.List;

public interface UserService {

    PageInfo<User> pageList(int pageNo, int pageSize, User user);

    List<User> list();

    boolean insert(User user);
    boolean delete(int id);
    boolean update(User user);
    boolean updateProfile(User user);
    boolean updatePassword(int userId, String oldPassword, String newPassword);

    User findById(int id);
    User findByUsername(String username);
    User findByEmail(String email);
    User findByUsernameOrEmail(String loginName);

    boolean register(User user);
    User login(String loginName, String password);

    boolean existsByUsername(String username);
    boolean existsByEmail(String email);
    boolean existsByUsernameExcludeId(String username, int excludeId);
    boolean existsByEmailExcludeId(String email, int excludeId);

    String generateAvatar(String username, int size);
}


